package com.senlingspace.web.controller.headquarters;


import com.senlingspace.system.domain.SlkjShopProjectFz;
import com.senlingspace.system.domain.dto.FzShopProjectDto;
import com.senlingspace.system.service.ISlkjShopProjectFzService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.senlingspace.common.annotation.Log;
import com.senlingspace.common.core.controller.BaseController;
import com.senlingspace.common.core.domain.AjaxResult;
import com.senlingspace.common.enums.BusinessType;

/**
 * 分账比例-门店项目关联Controller
 * 
 * @author wangliang
 * @date 2024-07-15
 */
@RestController
@RequestMapping("/system/projectShop")
public class SlkjShopProjectFzController extends BaseController
{
    @Autowired
    private ISlkjShopProjectFzService projectFzService;


    /**
     * 新增分账比例-门店项目关联
     */
    @PreAuthorize("@ss.hasPermi('system:projectShop:add')")
    @Log(title = "分账比例-门店项目关联", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SlkjShopProjectFz projectFz)
    {
        return toAjax(projectFzService.insertSlkjShopProjectFz(projectFz));
    }


    /**
     * 修改分账比例-门店项目关联
     */
    @PreAuthorize("@ss.hasPermi('system:projectShop:edit')")
    @Log(title = "分账比例-门店项目关联", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody FzShopProjectDto projectFz){
        return toAjax(projectFzService.updateFzShopProjectById(projectFz));
    }

    /**
     * 删除分账比例-门店项目关联
     */
    @PreAuthorize("@ss.hasPermi('system:projectShop:remove')")
    @Log(title = "删除分账比例-门店项目关联", businessType = BusinessType.UPDATE)
    @DeleteMapping
    public AjaxResult remove(@RequestBody FzShopProjectDto projectFz){
        return toAjax(projectFzService.deleteFzShopProjectById(projectFz));
    }


}
